//
//  EvaluatePhoneItemCell.m
//  FD
//
//  Created by xiaofang wang on 2018/11/12.
//  Copyright © 2018年 ZhiYuan Network. All rights reserved.
//

#import "EvaluatePhoneItemCell.h"
@interface EvaluatePhoneItemCell()

@end

@implementation EvaluatePhoneItemCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {

    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    //iv
    self.iv.frame = self.contentView.bounds;
    [self.contentView addSubview:self.iv];
    
    CGFloat sw = self.contentView.bounds.size.width;
    CGFloat sh = self.contentView.bounds.size.height;
    
    CGFloat h = sh/4; //4分之一高度
    self.lightbgView.frame = CGRectMake(0, sh-h, sw, h);
    [self.iv addSubview:self.lightbgView];
    
    self.deleteBtn.frame = self.lightbgView.bounds;
    [self.lightbgView addSubview:self.deleteBtn];
}

- (UIImageView *)iv {
    if(!_iv) {
        _iv = [UIImageView new];
    }
    return _iv;
}

- (UIView *)lightbgView {
    if (!_lightbgView) {
        _lightbgView = [UIView new];
        _lightbgView.backgroundColor = rgba(0, 0, 0, 0.4);
    }
    return _lightbgView;
}

- (UIButton *)deleteBtn {
    if (!_deleteBtn) {
        _deleteBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
        NSString *scStr = NSLocalizedString(L_Delete, @"删除");
        [_deleteBtn setTitle:scStr forState:(UIControlStateNormal)];
        [_deleteBtn setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
    }
    return _deleteBtn;
}
@end
